This invention relates to an image processing apparatus and method that can detect (recognize) an object of interest within image, as exemplified by detecting a red-eye (an eye with the red-eye effect) from a photographic image, as well as a red-eye detection method for detecting a red-eye from within an image and programs for executing the image processing method and the red-eye detection method.
The digital photoprinter has been recently commercialized as an apparatus that makes photoelectric reading of an image recorded on a film, converts the image to digital signal, performs various image processing steps on the digital signal to create image data for recording purposes, exposing a photographic material to recording light modulated in accordance with the image data, and outputs the original image as print.
In the digital photoprinter, the image recorded on a film is read photoelectrically and, after the image is converted to digital image data, various image processing schemes and exposing of the photographic material are performed. Hence, print can be created not only from the image recorded on a film but also from the image (image data) recorded with a digital camera and the like.
With the recent growth in the use of personal computers (PCs) and digital cameras, as well as inexpensive color printers such as the ink-jet printer, it has become commonplace for many users to take a picture with their digital camera, download it into their PC, perform image processing and output the finished image from a printer.
More recently, there has been commercialized a newer type of printer that makes direct reading of image data from storage media such as SMART MEDIA™ and COMPACT™ flash storing the image taken with a digital camera and which performs specified image processing steps, as well as outputting a print (hard copy) that carries the finished image.
Speaking of portraits and other pictures showing a human subject, one of the most important elements that affect the image quality is how the human subject finally comes out in the image. Therefore, the red-eye effect, or a human subject's eye (pupil) appearing red due to the burst of an electronic flash used to take the picture, is a critical problem.
With the conventional photoprinter which performs direct exposure on film, red-eye correction is a very difficult task to deal with. However, in the case of digital image processing as is performed by the digital photoprinter, red-eye correction can be effected by first detecting the red-eye through image processing (image analysis) and transforming the image data for the red-eye region, as well as performing color/density correction on the transformed image data. Hence, various methods have been proposed for detecting the red-eye within an image by means of image processing.
For example, JP 2002-247596A discloses a method in which on the basis of image characteristic quantities for a region of interest including the eye region of an image, characteristic regions including the iris region are detected from the region of interest and the red-eye region or regions are specified using the positional relationship between the iris region and another characteristic region, as exemplified by the degree of contact between the iris region and another characteristic region, the area ratio between the region of interest and the red-eye region, and as to whether the iris region includes another region (e.g. the pupil region) or not.
As another example, JP 2003-36438A discloses a method in which on the basis of image characteristic quantities for a region of interest including the eye region of an image, a plurality of characteristic regions including the iris region (possible region for the red-eye region) are detected from the region of interest using its color hue, saturation and lightness, and the red-eye region is specified on the basis of contact or non-contact between the iris region and another characteristic region, the gradation characteristics of the image characteristic quantities for the characteristic regions and the area information for the characteristic regions.
The red-eye effect is a phenomenon peculiar to human subjects, animals and other natural subjects. Here the images (image data) of human subjects, animals and other natural subjects change greatly with various kinds of conditions. In other words, the image processing of natural subjects involves great changes in the subject's size, brightness/density, distortion and other parameters of the processing depending upon various kinds of conditions.
For instance, the size of the subject within the image varies greatly with the shooting distance. In addition, depending on the exposure to sunshine which varies with weather or locality, the color, density or brightness of a part of the subject such as face will vary.
The conventional methods (algorithms) for red-eye detection, including those disclosed in JP 2002-247596A and Jp 2003-36438A, can detect red-eye in a satisfactory way under particular conditions.
However, as mentioned above, the parameters to image processing of natural subjects vary considerably depending on case. Given such varying parameters, it is impossible to perform red-eye detection in an appropriate way by the prior art.